import java.awt.Color;
import java.awt.Graphics;
import java.util.LinkedList;

import javax.swing.JFrame;


public class Transmit extends Weapon {
	Unit enemy;

	public Transmit( LinkedList<Effect> effects, Unit enemy, double startX, double startY, double endX, double endY, double size, double ap ){
		super(effects,startX,startY,endX,endY,size,ap);
		this.enemy = enemy;

	}

	double scaledStartX;
	double scaledStartY;
	double scaledEndX;
	double scaledEndY;
	double scaledSize;
	int G = 0;

	public void scale( double size, double normal, double [] ref){
		scaledStartX = startX*size/normal + ref[0] ;
		scaledStartY = startY*size/normal + ref[1] ;
		scaledEndX = enemy.getX()*size/normal + ref[0];
		scaledEndY = enemy.getY()*size/normal + ref[1];
		scaledSize = this.size*size/normal;
	}

	public boolean getAlive(){ return alive; }

	public void damage(){
		if(enemy.currentPathNodeIndex<1){
			enemy.currentPathNodeIndex = 0;
		}
		else{
			enemy.currentPathNodeIndex = enemy.currentPathNodeIndex-1;
		}
		enemy.pos[0] = enemy.pathSet.get(enemy.currentPathNodeIndex).getX();
		enemy.pos[1] = enemy.pathSet.get(enemy.currentPathNodeIndex).getY();
		//effects.add( new Explosion(enemy.getX(),enemy.getY(),15,10) );

	}
	public void work(){
		damage();
	}

	public void draw(Graphics g, JFrame c){
		alive = false;
		G -= 10;
	}
}
